-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade Dart2 template to advertised best-practices, plenty of additions too. #7585
Upgrade Dart2 template to advertised best-practices, plenty of additions too. #7585
Conversation
samples/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/dart2/api.mustache
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/dart2/api_client.mustache
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/dart2/api_client.mustache
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/dart2/api_test.mustache
Outdated
Show resolved
Hide resolved
To summarize my comments above, dart-lang says to prefer single quotes https://github.com/dart-lang/pedantic/#stricter-than-effective-dart. |
Thanks @agilob for the review. What do you think? |
Running Am I doing something wrong? |
you don't need to run all configs, just select the ones your changes affect |
Calm down with changes now, this is massive PR ;) |
/me Calming down... |
@noordawod thanks for the PR. Can you please resolve the merge conflicts when you've time? |
modules/openapi-generator/src/main/resources/dart2/auth/http_basic_auth.mustache
Outdated
Show resolved
Hide resolved
@noordawod let's go ahead with this PR. Thanks for the contribution. |
It's been a pleasure guys, thank you for merging it! |
This upgrades the Dart2 template to advertised best-practices by the Dart team and most importantly, use
{{{ }}}
to reference variables instead of{{ }}
since the latter is for escaping values. It happened to me that occasionally the generated code would include"
and&#XX;
escape characters for some reason or another.Few additions were added too:
growable
to most calls that returns aList
. Defaults to not allow growing a returned list.=>
).final
variables where possible.PR checklist
./bin/generate-samples.sh
to update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example./bin/generate-samples.sh bin/configs/java*
. For Windows users, please run the script in Git BASH.master
@ircecho (2017/07) @swipesight (2018/09) @jaumard (2018/09) @athornz (2019/12) @amondnet (2019/12) @wing328